// pages/UserLogin/index.js
Page({
  data: {

  },
  // shiyan(e){
  //     wx.showToast({
  //       title: '请输入您的邮箱',
  //     });
  // },
  UserLogin(e) {
    const u_email = e.detail.value.userEmail
    const u_password = e.detail.value.password
    wx.request({
      // 标题
      url: 'http://460d80b632.zicp.vip/WeChat/doLogin.php',
      method: "POST",
      data: {
        "u_email": u_email,
        "u_password": u_password
      },
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      success: (res) => {
        console.log(res);
        wx.setStorage({
          key: "user",
          data: res.data[0]
        });
        wx.setStorage({
          key: "property",
          data: res.data[1]
        });
        if (res.data.success) {
          wx.reLaunch({
            url: '/pages/User/index',
          });
          // return;
        } else {
          wx.showToast({
            title: res.data.msg,
            icon: "error",
          });
        }
        
      }
    });

  }
})